﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace csctp
{
	/// <summary>
	/// 报单
	/// </summary>
	public class OrderField
	{
		/// <summary>
		/// 报单标识
		/// </summary>
		[DisplayName("报单编号")]
		public string OrderID { get; set; }

		/// <summary>
		/// 合约
		/// </summary>
		[DisplayName("合约")]
		public string InstrumentID { get; set; }

		/// <summary>
		/// 买卖
		/// </summary>
		[DisplayName("买卖")]
		public DirectionType Direction { get; set; }

		/// <summary>
		/// 开平
		/// </summary>
		[DisplayName("开平")]
		public OffsetType Offset { get; set; }

		/// <summary>
		/// 报价
		/// </summary>
		[DisplayName("报单价格")]
		public double LimitPrice { get; set; }

		/// <summary>
		/// 成交均价
		/// </summary>
		[DisplayName("成交均价")]
		public double AvgPrice { get; set; }

		/// <summary>
		/// 报单时间(交易所)
		/// </summary>
		[DisplayName("报单时间")]
		public string InsertTime { get; set; }

		/// <summary>
		/// 最后成交时间(撤单状态时为撤单时间-IsLocal有效)
		/// </summary>
		[DisplayName("成撤时间")]
		public string TradeTime { get; set; }

		/// <summary>
		/// 末次成交量,trade更新
		/// </summary>
		[DisplayName("末次成交量")]
		public int TradeVolume { get; set; }

		/// <summary>
		/// 报单数量
		/// </summary>
		[DisplayName("报单数量")]
		public int Volume { get; set; }

		/// <summary>
		/// 未成交,trade更新
		/// </summary>
		[DisplayName("未成交手数")]
		public int VolumeLeft { get; set; }

		/// <summary>
		/// 投保
		/// </summary>
		[DisplayName("投保")]
		public HedgeType Hedge { get; set; }

		/// <summary>
		/// 状态
		/// </summary>
		[DisplayName("状态")]
		public OrderStatus Status { get; set; }

		/// <summary>
		/// 状态描述
		/// </summary>
		[DisplayName("详细状态")]
		public string StatusMsg { get; set; }

		/// <summary>
		/// 是否自身委托
		/// </summary>
		[DisplayName("本地报单")]
		public bool IsLocal { get; set; }

		/// <summary>
		/// 客户自定义字段(xSpeed仅支持数字)
		/// </summary>
		[DisplayName("自定义")]
		public int Custom { get; set; }

		/// <summary>
		/// 交易所生成的ID
		/// </summary>
		[DisplayName("交易所编号")]
		public string SysID { get; set; }
	}
}
